{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<include file="Public:new" />
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/js/user.js' />
<load href='__TMPL__Common/js/deal.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<div class="main">
    <div class="main_title_list"><div class="list-line-ico"></div>主播列表 <a href="javascript:clear_view_count()" title="清空累计观看 ">清空累计观看</a>（必须非运营时候清除，否则导致数据库卡死）</div>
    <php>
        function get_level($level){
        $user_level = $GLOBALS['db']->getOne("select `name` from ".DB_PREFIX."user_level where level = '".intval($level)."'");
        return $user_level;
        }
        function head_image($head_image){
        return "<img src='".$head_image."' style='height:35px;width:35px;'/>";
        }
        function get_online($is_online){
        if($is_online==1){
        return '是';
        }else{
        return '否';
        }
        }

        function forbid_msg($id,$user){
        if($user['is_nospeaking']==1){
        return "<a href=\"javascript:forbid_msg('".$id."')\">解除im全局禁言</a>";
        }else{
        return "<a href=\"javascript:forbid_msg('".$id."')\">im全局禁言</a>";
        }
        }
        function get_is_nospeaking($is_nospeaking){
        if($is_nospeaking){
        return "是";
        }else{
        return "否";
        }
        }
        function get_distribution_log($id,$distribution_log){
        if($distribution_log){
        return "<a href=\"javascript:distribution_log('".$id."')\">分销奖励</a>";
        }
        return "";
        }
        function get_distribution_user($id,$distribution_log){
        if($distribution_log){
        return "<a href=\"javascript:distribution_user('".$id."')\">分销子用户</a>";
        }
        return "";
        }
        function get_coins($id,$coins){
        $open_game = intval(defined('OPEN_GAME_MODULE') && OPEN_GAME_MODULE);
        $open_diamond = intval(defined('OPEN_DIAMOND_GAME_MODULE') && OPEN_DIAMOND_GAME_MODULE);
        if($open_game && !$open_diamond){
        return "<a href=\"javascript:coins('".$id."')\">游戏币管理</a>";
        }
        return "";
        }
        function get_goods($id,$goods){
        if($goods){
        return "<a href=\"javascript:goods('".$id."')\">商品管理</a>";
        }
        return "";
        }
    </php>
    <!-- <div class="button_row">
        <input type="button" class="button" value="{%ADD}" onclick="add();" />
    </div>
     -->
    <script>
        function forbid_msg($id){
            var r=confirm("确定要修改状态？");
            if (r==true){
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=forbid_msg&user_id="+$id,
                    data: "",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
            }else{

            }
        }

        function goods(id){
            location.href = ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=goods&user_id="+id;
        }

        function clear_view_count()
        {
            if(confirm("确定要清空累计观看？"))
                $.ajax({
                    url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=clear_view_count",
                    data: "ajax=1",
                    dataType: "json",
                    success: function(obj){
                        alert(obj.info);
                        func();
                        function func(){
                            if(obj.status==1){
                                location.href=location.href;
                            }
                        }
                    }
                });
        }
    </script>
    <div class="search_row">
        <form name="search" action="__APP__" method="get" class="clearfix">
            <div>主播ID：<input type="text" class="textbox" name="id" value="{:trim($_REQUEST['id'])}" style="width:100px;" /></div>
            <div>主播类型：<select name="is_authentication">
                <option value="-1" selected="selected">所有</option>
                <option value="0,1,3" <if condition="$_REQUEST['is_authentication'] eq 0 "> selected="selected"</if>>普通主播</option>
                <option value="2"<if condition="$_REQUEST['is_authentication'] eq 2"> selected="selected"</if>>认证主播</option>
            </select></div>

            <div>手机号：<input type="text" class="textbox" name="mobile" value="{:trim($_REQUEST['mobile'])}" style="width:100px;" /></div>
            <div>主播昵称：<input type="text" class="textbox" name="nick_name" value="{:trim($_REQUEST['nick_name'])}" style="width:100px;" /></div>
            <div>注册时间：<span><input type="text" class="textbox" name="create_time_1" id="create_time_1" value="{$_REQUEST['create_time_1']}" onfocus="this.blur(); return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /><input type="button" class="button" id="btn_create_time_1" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_1', '%Y-%m-%d', false, false, 'btn_create_time_1');" /></span> - <span><input type="text" class="textbox" name="create_time_2" id="create_time_2" value="{$_REQUEST['create_time_2']}" onfocus="this.blur(); return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /><input type="button" class="button" id="btn_create_time_2" value="{%SELECT_TIME}" onclick="return showCalendar('create_time_2', '%Y-%m-%d', false, false, 'btn_create_time_2');" /></span>
                <input type="hidden" value="WeiboUserGeneral" name="m" /><input type="hidden" value="index" name="a" /><input type="submit" class="button" value="{%SEARCH}" /></div>
        </form>
    </div>
    <html:list
            id="dataTable"
            style="dataTable"
            name="user"
            action="true"
            datasource="list"
            show="id:主播ID
        ,nick_name:{%NICK_NAME}:edit
        ,head_image|head_image:{%USER_HEADIMAGE}
        ,focus_count:{%USER_FOCUS}:focus_list
        ,fans_count:{%USER_FANS}:fans_list
        ,user_level|get_level=$user['user_level']:{%LEVEL}
        ,is_ban|get_is_ban=$user['id']:{%IS_BAN}
        ,is_effect|get_is_effect=$user['id']:{%IS_EFFECT}
        ,weibo_recommend_weight|get_sort=$user['id']:推荐权重
        ,weixin_account:微信账号
        ,weixin_price:微信价格"
            actionlist="edit:{%EDIT}, account_detail:{%USER_ACCOUNT_DETAIL},id|get_distribution_log=$user['distribution_log'],id|get_distribution_user=$user['distribution_log']" />
    <script type="text/javascript">
        function coins(user_id)
        {
            var url = ROOT + "?" + VAR_MODULE + "=Games&" + VAR_ACTION + "=addCoin&user_id=" + user_id;
            $.ajax({
                url: url,
                data: "ajax=1",
                dataType: "json",
                success: function(msg) {
                    if (msg.status == 0) {
                        alert(msg.info);
                    }
                },
                error: function() {
                    $.weeboxs.open(url, {
                        contentType: 'ajax',
                        showButton: false,
                        title: '游戏币管理',
                        width: 600,
                        height: 260
                    });
                }
            });
        }
    </script>

    <!-- del:{%DEL}, -->
    <!--<table class="dataTable">
        <tbody>
            <td colspan="14">
                <input type="button" class="button button-del" value="{%DEL}" onclick="del();" />
            </td>
        </tbody>
    </table>-->
    <div class="page">{$page}</div>
</div>
<include file="Public:footer" />